import request from '@/config/axios'

export interface DistributionHistoryVO {
  id: number
  userId: number
  no: string
  name: string
  bizType: number
  title: string
  price: number
  totalPrice: string
  description: string
  frozenDays: number
  bizId: string
  status: number
  sourceUserLevel: number
  sourceUserId: number
  createTime: string
}

// 查询提现列表分页
export const getDistributionHistoryPage = async (params) => {
  return await request.get({url: `/order/brokerage-record/page`, params})
}

// 查询提现列表
export const getDistributionHistoryList = async (params) => {
  return await request.get({url: `/order/brokerage-record/list`, params})
}

// 查询提现详情
export const getDistributionHistory = async (id: number) => {
  return await request.get({url: `/order/brokerage-record/get?id=` + id})
}

// 新增提现
export const createDistributionHistory = async (data: DistributionHistoryVO) => {
  return await request.post({url: `/order/brokerage-record/create`, data})
}

// 修改提现
export const updateDistributionHistory = async (data: DistributionHistoryVO) => {
  return await request.put({url: `/order/brokerage-record/update`, data})
}

// 删除提现
export const deleteDistributionHistory = async (id: number) => {
  return await request.delete({url: `/order/brokerage-record/delete?id=` + id})
}

// 导出提现 Excel
export const exportDistributionHistory = async (params) => {
  return await request.download({url: `/order/brokerage-record/export-excel`, params})
}
